export const setToken = (token) => {
  localStorage.setItem("token", token);
};

export const getToken = () => {
  return localStorage.getItem("token");
};

export const clearToken = () => {
  localStorage.removeItem("token");
};

export const setUserInfo = (info) => {
  localStorage.setItem("user_info", JSON.stringify(info));
};

export const getUserInfo = () => {
  return JSON.parse(localStorage.getItem("user_info"));
};

export const clearUserInfo = () => {
  localStorage.removeItem("user_info");
};

export const setDataToken = (token) => {
  localStorage.setItem("data_token", token);
};

export const getDataToken = () => {
  return localStorage.getItem("data_token");
};

export const clearDataToken = () => {
  localStorage.removeItem("data_token");
};

export const clearAllUserInfo = () => {
  clearToken();
  clearUserInfo();
  clearDataToken();
};
